package org.dejavu.design.factory;

/**
* <p>Title: SendFactory</p>
* <p>Description: 工厂类</p>
* <p>Company: </p> 
* @author dejavu
* @date 2016-9-7 上午10:42:26
*/
public class SendFactory {
	/**
	 * @param type
	 * @return
	 */
	public Sender produce(String type) {
		if ("mail".equals(type)) {
			return new MailSender();
		}else if ("sms".equals(type)) {
			return new SmsSender();
		}else {
			System.out.println("请输入正确的类型");
			return null;
		}
	}
	//multiple factory
	public Sender produceMialSender() {
		return new MailSender();
	}
	//multiple fatory
	public Sender produceSmsSender() {
		return new SmsSender();
	}
	//static fatory
	public static Sender produceStaticMialSender() {
		return new MailSender();
	}
}
